package controller;

import java.io.IOException;
import java.io.PrintWriter;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * Servlet implementation class SA35SimilingClassServlet
 */
@WebServlet("/sleep")
public class SA35SimilingClassServlet extends HttpServlet {
	private static final long serialVersionUID = 1L;
       
    /**
     * @see HttpServlet#HttpServlet()
     */
    public SA35SimilingClassServlet() {
        super();
        // TODO Auto-generated constructor stub
    }
  // LOGGER
	/**
	 * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
	 */
	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		// TODO Auto-generated method stub
		processRequest(request, response);
	}

	private void processRequest(HttpServletRequest request,
			HttpServletResponse response) throws ServletException, IOException {
		// TODO Auto-generated method stub
		PrintWriter out = response.getWriter();
		out.println("<HTML><BODY>");
		out.println("<H1>SOME STUPID PAGE</H1>");
		out.println("<h2>NAME IS"+request.getParameter("name")+"</h2>");
		out.println("<h2>NICK NAME IS"+request.getParameter("nick")+"</h2>"+request.getQueryString());
		out.println("</BODY></HTML>");	
		System.out.println(":-) :-) :-) :-) :-) :-) :-) ");
		
		//DB
		//BIZ 
	}

	/**
	 * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)
	 */
	protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		// TODO Auto-generated method stub
		processRequest(request, response);
	}

}
